import request from '@/utils/request'

const clientApi = {
  // UserAdd: '/admin/user/add', // 用户添加

  // UserList: '/admin/user/list', // 用户列表

  UserUpdate: '/web/user/updateName', // 用户编辑姓名

  UserCheckVerifyCode: '/web/user/checkVerifyCode', // 校验短信验证码

  UserDetail: '/web/user/detail', // 用户详情

  UserForgetPassword: '/web/user/forgetPassword', // 忘记密码

  UserGetPicCode: '/web/user/getPicCode', // 获取图形验证码

  UserGetVerifyCode: '/web/user/getVerifyCode', // 获取短信验证码

  UserLoginByPassword: '/web/user/loginByPassword', // 密码登陆

  UserLogout: '/web/user/logout', // 注销

  UserRegister: '/web/user/register', // 注册

  UserUpdatePassword: '/web/user/updatePassword', // 修改密码

  UserLoginList: '/web/loginLog/list',      // 登录记录
}

// export function userAdd(parameter) {
//   return request({
//     url: clientApi.UserAdd,
//     method: 'post',
//     data: parameter,
//   })
// }

// export function userList(parameter) {
//   return request({
//     url: clientApi.UserList,
//     method: 'post',
//     data: parameter,
//   })
// }

export function userUpdate(parameter) {
  return request({
    url: clientApi.UserUpdate,
    method: 'post',
    data: parameter,
  })
}

export function userCheckVerifyCode(parameter) {
  return request({
    url: clientApi.UserCheckVerifyCode,
    method: 'post',
    data: parameter,
  })
}

export function userDetail(parameter) {
  return request({
    url: clientApi.UserDetail,
    method: 'post',
    data: parameter,
  })
}

export function userForgetPassword(parameter) {
  return request({
    url: clientApi.UserForgetPassword,
    method: 'post',
    data: parameter,
  })
}

export function userGetPicCode(parameter) {
  return request({
    url: clientApi.UserGetPicCode,
    method: 'post',
    data: parameter,
  })
}

export function userGetVerifyCode(parameter) {
  return request({
    url: clientApi.UserGetVerifyCode,
    method: 'post',
    data: parameter,
  })
}

export function userLoginByPassword(parameter) {
  return request({
    url: clientApi.UserLoginByPassword,
    method: 'post',
    data: parameter,
  })
}

export function userLogout(parameter) {
  return request({
    url: clientApi.UserLogout,
    method: 'post',
    data: parameter,
  })
}

export function userRegister(parameter) {
  return request({
    url: clientApi.UserRegister,
    method: 'post',
    data: parameter,
  })
}


export function userUpdatePassword(parameter) {
  return request({
    url: clientApi.UserUpdatePassword,
    method: 'post',
    data: parameter,
  })
}

export function userLoginList(parameter) {
    return request({
      url: clientApi.UserLoginList,
      method: 'post',
      data: parameter,
    })
  }
